/*
 * Quadcopter.h
 *
 *  Created on: 6 mei 2013
 *      Author: Wietse
 */

#ifndef QUADCOPTER_H_
#define QUADCOPTER_H_

#include "../Vehicle.h"
#include "../main.h"
#include "QAgent.h"
#include "SoloQAgent.h"
#include "../Crawler.h"
#include <iostream>
#include <fstream>

// Fix for using Swarm
class Swarm;

class Quadcopter : public Vehicle
{
private:
	QAgent						agent;

	//std::vector<Quadcopter*>	nearbyQuadcopters;
	std::vector<Crawler*> 		nearbyCrawlers;
	void						seperate(Quadcopter *);
	double						timer;
	bool						targetReached;	//Used to see if target is getting out of reach again.

	void 						senseCrawlers(Swarm *);
public:
	Quadcopter();
	Quadcopter(int, Swarm *, Position);
	virtual ~Quadcopter();

	void   		update(Swarm*, double, Quadcopter*);
	void 		updatePosition(Swarm*, double, Quadcopter*);
	void		sendMessage(Swarm*, double);
	void		display();
	void		checkIfQuadcopterNearby(Quadcopter *);
	void 		clearNearbyQuadcopters();	//Clears the list of nearbyQuadcopters, so it can be recalculated for instance
	Position 	velocity;
	Position 	target;
};

#endif /* QUADCOPTER_H_ */
